home *** CD-ROM | disk | FTP | other *** search
- #!/bin/sh
-
- # Remove a no-longer used conffile (from http://wiki.debian.org/DpkgConffileHandling)
- rm_conffile() {
- PKGNAME="$1"
- CONFFILE="$2"
- if [ -e "$CONFFILE" ]; then
- md5sum="`md5sum \"$CONFFILE\" | sed -e \"s/ .*//\"`"
- old_md5sum="`dpkg-query -W -f='${Conffiles}' $PKGNAME | sed -n -e \"\\\\' $CONFFILE'{s/ obsolete$//;s/.* //p}\"`"
- if [ "$md5sum" != "$old_md5sum" ]; then
- echo "Obsolete conffile $CONFFILE has been modified by you."
- echo "Saving as $CONFFILE.dpkg-bak ..."
- mv -f "$CONFFILE" "$CONFFILE".dpkg-bak
- else
- echo "Removing obsolete conffile $CONFFILE ..."
- rm -f "$CONFFILE"
- fi
- fi
- }
-
-
- case "$1" in
- install|upgrade)
- if dpkg --compare-versions "$2" le "0.107"; then
- rm_conffile acpi-support "/etc/modprobe.d/thinkpad_acpi.modprobe"
- fi
- if dpkg --compare-versions "$2" le "0.108"; then
- rm_conffile acpi-support "/etc/acpi/events/lenovo-eject"
- fi
- if dpkg --compare-versions "$2" le "0.116"; then
- for conffile in events/ibm-sleepbtn events/ibm-lockbtn \
- thinkpad-lockorbattery.sh events/ibm-hibernatebtn \
- events/lenovo-lockbtn events/ibm-videobtn \
- events/thinkpad-mute always-mute.sh \
- events/thinkpad-volume-down events/thinkpad-volume-up \
- events/thinkpad-zoom thinkpad-zoom.sh \
- events/thinkpad-thinklight thinkpad-thinklight.sh \
- events/tosh-brightness-up events/tosh-brightness-down \
- events/tosh-brightness-down events/tosh-mute \
- events/tosh-sleep events/sony-hibernate \
- events/sony-brightness-up events/sony-brightness-down \
- sonybright.sh events/thinkpad-brightness-down \
- events/thinkpad-brightness-up thinkpad-brightness-up.sh \
- thinkpad-brightness-down.sh
- do
- rm_conffile acpi-support "/etc/acpi/${conffile}"
- done
- fi
- if dpkg --compare-versions "$2" le-nl "0.117"; then
- rm_conffile acpi-support "/etc/acpi/events/asus-mail"
- fi
- if dpkg --compare-versions "$2" le-nl "0.119"; then
- rm_conffile acpi-support /etc/init.d/vbesave
- rm_conffile acpi-support /etc/acpi/resume.d/17-video-restore.sh
- rm_conffile acpi-support /etc/acpi/suspend.d/80-video-vesa-state.sh
- rm_conffile acpi-support /etc/acpi/suspend.d/80-video-pci-state.sh
- update-rc.d vbesave remove
- fi
- if dpkg --compare-versions "$2" le-nl "0.120"; then
- rm_conffile acpi-support /etc/acpi/suspend.d/88-time.sh
- rm_conffile acpi-support /etc/acpi/resume.d/50-time.sh
- rm_conffile acpi-support /etc/modprobe.d/toshiba_acpi.modprobe
- fi
- if dpkg --compare-versions "$2" lt-nl "0.121"; then
- rm_conffile acpi-support /etc/modprobe.d/ibm_acpi.modprobe
- fi
- esac
-
-
-
-